package com.csxy.systemmanager.controller;

import com.csxy.systemmanager.common.ResponseResult;
import com.csxy.systemmanager.dao.AuthDao;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户权限接口
 */
@RestController
@RequestMapping("/auth")
@CrossOrigin
public class AuthController {

    private AuthDao authDao;

    public AuthController(AuthDao authDao) {
        this.authDao = authDao;
    }

    /**
     * 查询用户及其对应的角色
     */
    @GetMapping("/list")
    public ResponseResult getUserAndRole(Integer current, Integer size, String query) {
        return new ResponseResult(200,"ok",authDao.getUserAndRole());
    }
}
